Mac OS 8.5 Technote: Part VIII[Previous section] [Mac OS 8.5 Contents Page] [Next section] |
The System file contains code and resources for running the computer. This section describes new features, changes, and bug fixes in the System file. The functionality provided by the System file is always present under Mac OS 8.5, even when the shift key is held down at system startup. General
|
- WARNING:
- Developers should not assume the emulated 68K processor is running in supervisor mode when Virtual Memory is OFF.
Developers who require access to supervisor mode 68K instructions can use the |
Listing 1. The correct way to ensure the 68K processor is in supervisor mode.; Is _DebugUtil available? ; Code running on a IIci or later can skip this step. move.w #_Unimplemented,d0 _GetToolTrapAddress move.l a0,-(sp) move.l #$A08D,d0 ; get _DebugUtil _GetToolTrapAddress cmpa.l (sp)+,a0 ; was this previously ; unimplemented? beq.s @noEnterSupervisorMode ; Is the _EnterSupervisorMode selector available? _DebuggerGetMax ; check how many _DebugUtil ; selectors are implemented cmpi.l #8,d0 ; is selector 8 available? blt.s @noEnterSupervisorMode ; EnterSupervisorMode isn't ; available _EnterSupervisorMode ; switch to supervisor mode ; (switches stacks) move.w d0,-(sp) ; and save the previous SR contents ; on the stack bra.s @inSupervisorMode ; If _EnterSupervisorMode wasn't available, then put ; sr on the stack @noEnterSupervisorMode move sr,-(sp) ; save the current SR @inSupervisorMode ; ... ; do stuff in supervisor mode ; remember that the stack has been swapped if we switched ; from user mode to supervisor mode. ; ... move (sp)+,sr ; restore the SR |
- COMPATIBILITY NOTE
DebuggerGetMax
is available on all machines supported by Mac OS 8.5. On other systems, developers must test for the_DebugUtil
trap before callingDebuggerGetMax
.Testing for VM to determine if the_EnterSupervisorMode
trap should be used is considered a programming error: developers should use the above method instead.
|
![]() [Previous section] [Mac OS 8.5 Contents Page] [Next section] To contact us, please use the Contact Us page. |